import java.util.*;

public class Mian{
    public static void main(String[] args){

    }
}

class UniFindSet{
    private int size;
    private int[] father;
    UniFindSet(int size){  //构造函数
        this.size = size;
        for( int i=0; i<size; ++i){
            father[i] = i;
        }
    }

    public int findFather(int x){
        if(father[x]==x) return x;
        return father[x] = findFather(father[x]);
    }

    public void union(int x, int y){
        x = findFather(x);
        y = findFather(y);
        father[x] = y;
    }
}